<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // symbol是es新增的一种基本数据类型
    // symbol表示的是一种独一无二的值

    const a = Symbol("abc");
    const b = Symbol("abc");
    console.log(a);
    console.log(b);
    console.log(a === b); // false


    // 场景：在一个未知的对象里面挂载新属性

    const obj = {
      a: 3,
      b: 4,
      // ...
    }
    const key = Symbol("name")
    obj[key] = "zhangsan";
    console.log(obj);
    console.log(obj[key]);
    
    

    
  </script>
</body>
</html>